﻿<controls:ChildWindow
    x:Class="EyeOpen.TimeAssistant.UI.Silverlight.ErrorWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    Title="ErrorWindow">

    <Grid 
        DataContext="{Binding Path=UserViewModel, Source={StaticResource viewModelLocator}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock
            Grid.Row="0" 
            Margin="0"
            Width="400" 
            TextWrapping="Wrap"
            Text="{Binding IntroductoryText, Mode=TwoWay}"
            HorizontalAlignment="Left"/>

        <StackPanel
            Grid.Row="2" 
            Margin="0,6,0,0">
            <TextBlock
                TextWrapping="Wrap" 
                Margin="0,0,0,2"
            />
            <TextBox
                Height="90" 
                TextWrapping="Wrap"
                IsReadOnly="True"
                Text="{Binding ErrorText, Mode=TwoWay}"
                VerticalScrollBarVisibility="Auto"/>
        </StackPanel>

        <Button
            Grid.Row="3" 
            Command="{Binding Path=CloseErrorWindowCommand}"
            Width="75"
            Height="23"
            HorizontalAlignment="Right"
            Margin="0,10,0,0" 
            Content="OK"/>
    </Grid>
</controls:ChildWindow>